﻿using DXApplicationTangche.DTO;
using DXApplicationTangche.model;
using DXApplicationTangche.service;
using DXApplicationTangche.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DXApplicationTangche.UC.面料
{
    public partial class Frm面料上传 : DevExpress.XtraBars.Ribbon.RibbonForm
    {
        public List<面料导入DTO> DTOs = new List<面料导入DTO>();
        public 面料导入Model Model { get; set; }
        public Frm面料上传()
        {
            InitializeComponent();
            this.Model=new 面料导入Model(this.DTOs);
        }

        private void barButtonItem上传CSV_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            //OpenFileDialog ofd = new OpenFileDialog();
            //ofd.Title = "请选择CSV文件";
            //if (!String.IsNullOrEmpty(MIMEConst.CSV_MIME))
            //{
            //    ofd.Filter = MIMEConst.CSV_MIME;
            //}
            //if (ofd.ShowDialog() == DialogResult.OK)
            //{
            this.DTOs = 面料导入Service.GetDTOsFromExcelByConn(true);
            this.Model = new 面料导入Model(this.DTOs);
            this.gridControl面料一览.DataSource = this.Model.面料导入DTOs;
            //}
        }

        private void Frm面料上传_Activated(object sender, EventArgs e)
        {
            this.Model = new 面料导入Model(this.DTOs);
            this.gridControl面料一览.DataSource = this.Model.面料导入DTOs;
        }
    }
}
